<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.js"></script>
    <script src="https://cdn.bootcss.com/jquery.repeater/1.2.1/jquery.repeater.js"></script>
</head>
<body>
<h2>Repeater</h2>
<form action="echo.php" class="repeater" enctype="multipart/form-data">
    <div data-repeater-list="group-a">
        <div data-repeater-item>
            <input name="untyped-input" value="A"/>
            <input type="text" name="text-input" value="B"/>
            <input data-repeater-delete type="button" value="删除"/>
        </div>
    </div>
    <input data-repeater-create type="button" value="增加"/>
</form>
<script>
    $(function () {

        $('.repeater').repeater({
            defaultValues: {
                'text-input': 'bar'
            },
            show: function () {
                $(this).slideDown();
            },
            hide: function (deleteElement) {
                if (confirm('Are you sure you want to delete this element?')) {
                    $(this).slideUp(deleteElement);
                }
            },
            ready: function (setIndexes) {

            }
        });
    })
</script>
</body>
</html>